package com.adayo.memoryfree.activity;

import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.View;

import com.adayo.memoryfree.R;
import com.adayo.memoryfree.base.ActivityFrame;
import com.adayo.memoryfree.fragment.SettingFragment;
import com.adayo.memoryfree.widgets.TitleView;

import org.xutils.view.annotation.ViewInject;

public class SettingsActivity extends ActivityFrame {
	@ViewInject(R.id.tv_title)
	private TitleView titleView;

	@Override
	protected int getLayoutId() {
		return R.layout.activity_settings;
	}

	@Override
	protected void initParams(Bundle savedInstanceState) {
		titleView.setResource(R.drawable.selector_return_btn,
				R.string.title_settings);
		titleView.setLeftClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});

		FragmentTransaction ft = getFragmentManager().beginTransaction();
		SettingFragment fragment = new SettingFragment();
		ft.add(R.id.contentFrame, fragment);
		ft.commitAllowingStateLoss();
	}

	@Override
	protected String[] initPermissions() {
		return new String[0];
	}
}
